<template>
  <div class="footer">
    <ul>
      <li :key="key" v-for="nav,key in nav_list">
        <a :href="nav.link" target="_blank" v-if="nav.is_http">{{nav.name}}</a>
        <router-link :to="nav.link" v-else>{{nav.name}}</router-link>
      </li>
    </ul>
    <p>Copyright © luffycity.com版权所有 | 京ICP备17072161号-1</p>
  </div>
</template>

<script>
  import instance from '@/utils/request'
  export default {
    name: "Footer",
    data(){
      return {
        nav_list:[]
      }
    },
    created() {
      this.get_nav_list()
    },
    methods:{
      get_nav_list(){
        // 获取导航菜单
        instance.get('/nav/footer/',{}).then(res=>{
          this.nav_list=res.data;
        });
        // this.$axios.get(`${this.$settings.Host}/nav/footer/`).then(response=>{
        //   this.nav_list = response.data;
        // }).catch(error=>{
        //   this.$message.error("对不起，获取导航菜单失败！");
        // });
      }
    }
  }
</script>

<style scoped>
  .footer {
    width: 100%;
    height: 128px;
    background: #25292e;
    color: #fff;
  }
  .footer ul{
    margin: 0 auto 16px;
    padding-top: 38px;
    width: 810px;
  }
  .footer ul li{
    float: left;
    width: 112px;
    margin: 0 10px;
    text-align: center;
    font-size: 14px;
  }
  .footer ul li a{
    color: #ffffff;
  }
  .footer ul::after{
    content:"";
    display:block;
    clear:both;
  }
  .footer p{
    text-align: center;
    font-size: 12px;
  }
</style>
